package com.ruoyi.zhmk.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zhmk.mapper.ZhmkCarsendMapper;
import com.ruoyi.zhmk.domain.ZhmkCarsend;
import com.ruoyi.zhmk.service.IZhmkCarsendService;
import com.ruoyi.common.core.text.Convert;

/**
 * 车辆下发Service业务层处理
 * 
 * @author sxl
 * @date 2021-06-10
 */
@Service
public class ZhmkCarsendServiceImpl implements IZhmkCarsendService 
{
    @Autowired
    private ZhmkCarsendMapper zhmkCarsendMapper;

    /**
     * 查询车辆下发
     * 
     * @param carsendId 车辆下发ID
     * @return 车辆下发
     */
    @Override
    public ZhmkCarsend selectZhmkCarsendById(Long carsendId)
    {
        return zhmkCarsendMapper.selectZhmkCarsendById(carsendId);
    }

    /**
     * 查询车辆下发列表
     * 
     * @param zhmkCarsend 车辆下发
     * @return 车辆下发
     */
    @Override
    public List<ZhmkCarsend> selectZhmkCarsendList(ZhmkCarsend zhmkCarsend)
    {
        return zhmkCarsendMapper.selectZhmkCarsendList(zhmkCarsend);
    }

    /**
     * 新增车辆下发
     * 
     * @param zhmkCarsend 车辆下发
     * @return 结果
     */
    @Override
    public int insertZhmkCarsend(ZhmkCarsend zhmkCarsend)
    {
        zhmkCarsend.setCreateTime(DateUtils.getNowDate());
        return zhmkCarsendMapper.insertZhmkCarsend(zhmkCarsend);
    }

    /**
     * 修改车辆下发
     * 
     * @param zhmkCarsend 车辆下发
     * @return 结果
     */
    @Override
    public int updateZhmkCarsend(ZhmkCarsend zhmkCarsend)
    {
        zhmkCarsend.setUpdateTime(DateUtils.getNowDate());
        return zhmkCarsendMapper.updateZhmkCarsend(zhmkCarsend);
    }

    /**
     * 删除车辆下发对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteZhmkCarsendByIds(String ids)
    {
        return zhmkCarsendMapper.deleteZhmkCarsendByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除车辆下发信息
     * 
     * @param carsendId 车辆下发ID
     * @return 结果
     */
    @Override
    public int deleteZhmkCarsendById(Long carsendId)
    {
        return zhmkCarsendMapper.deleteZhmkCarsendById(carsendId);
    }
}
